Conversation
|
Duplicate profile check: Passed - no duplicate profiles detected. |
Test Results0 tests 0 ✅ 0s ⏱️ Results for commit 7cad4d8. ♻️ This comment has been updated with latest results. |
|
Minimum allowed coverage is Generated by 🐒 cobertura-action against 7cad4d8 |
| local zcl_clusters = require "st.zigbee.zcl.clusters" | ||
| local window_shade_utils = require "window_shade_utils" | ||
| local utils = require "st.utils" | ||
|
|
There was a problem hiding this comment.
missing this
local log = require "log"
| [capabilities.windowShadePreset.commands.presetPosition.NAME] = window_shade_preset_cmd | ||
| }, | ||
| [capabilities.statelessSwitchLevelStep.ID] = { | ||
| [capabilities.statelessSwitchLevelStep.commands.stepLevel.NAME] = knob_to_window_shade_step_cmd |
There was a problem hiding this comment.
Please remove 'knob' word in the code.
'window_shade_step_level_cmd' would be better.
knob_target -> target_level
| log.info("------------->IKEA knob step size:", step) | ||
|
|
||
| -- Priority: use knob_target_level if exists | ||
| local knob_target = device:get_field("knob_target_level") |
There was a problem hiding this comment.
device:set_field("knob_target_level", nil) <= This logic needs to be added in the window_shade_level_cmd / window_shade_preset_cmd after 'set_shade_level'.
User can change the level through App UI while curtain is moving by knob.
If the 'knob_target_level' is not reset, knob_target will affect in next 'knob_to_window_shade_step_cmd'.
| log.info("---------->IKEA curtain report level:", level, "knob_target:", knob_target) | ||
| if knob_target then | ||
| -- Allow ±1 degree tolerance for reaching target | ||
| if math.abs(level - knob_target) <= 1 then |
There was a problem hiding this comment.
Let's extract the the '1' to the global constant.
local TARGET_REACH_TOLERANCE = 1 -- ±1 degree tolerance for reaching target
BWT, Is '±1' enough?
0172af6 to
7cad4d8
Compare
Check all that apply
Type of Change
Checklist
Description of Change
Summary of Completed Tests